import {get,post,prefix,state} from '@/api/api'
import Mock, { mock } from 'mockjs'

Mock.mock(prefix+'/getheadmessage',get,()=>{
    return {
        data:Mock.mock('@cword(10)'),
        code:200,
        msg:null
    }
})

Mock.mock(prefix+'/getusphone',get,()=>{
    return {
        data:Mock.mock({
            'regexp': /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/

          }).regexp
    }
})

Mock.mock(prefix+'/getnavbarList',get,()=>{
    return {
        data:[
            {  path: '/fruitsvegetables', meta: { id: Mock.mock('@id'),title: '水果蔬菜', pagemark: 'fruitsvegetables', name: '水果蔬菜' }, component: 'category.vue', },
            {  path: '/dairymeat', meta: { id: Mock.mock('@id'),title: '乳肉制品', pagemark: 'dairymeat', name: '乳肉制品' }, component: 'category.vue' },
            {  path: '/supplies', meta: { id: Mock.mock('@id'),title: '生活用品', pagemark: 'supplies', name: '生活用品' }, component: 'category.vue' },
            {  path: '/officeStudy', meta: { id: Mock.mock('@id'),title: '学习用品', pagemark: 'officeStudy', name: '学习用品' }, component: 'category.vue' },

            {  path: '/sundry', meta: { id: Mock.mock('@id'),title: '杂货铺', pagemark: 'sundry', name: '杂货铺' }, component: 'sundry.vue' },
            {  path: '/promotions', meta: { id: Mock.mock('@id'),title: '优惠促销', requireAuth: false, pagemark: 'promotions' , name: '优惠促销'}, component: 'promotions.vue' },
           
            // {  path: '/cart', meta: { id: Mock.mock('@id'),title: '购物车', requireAuth: true, pagemark: 'cart' , name: '购物车'}, component: 'cart.vue' },
        ]
    }
})
Mock.mock(prefix+'/isUpdateNavlist',get,()=>{
    return {
        data:[
            {  path: '/fruitsvegetables', meta: { id: Mock.mock('@id'),title: '水果蔬菜', pagemark: 'fruitsvegetables', name: '水果蔬菜' }, component: 'category.vue', },
            {  path: '/dairymeat', meta: { id: Mock.mock('@id'),title: '乳肉制品', pagemark: 'dairymeat', name: '乳肉制品' }, component: 'category.vue' },
            {  path: '/supplies', meta: { id: Mock.mock('@id'),title: '生活用品', pagemark: 'supplies', name: '生活用品' }, component: 'category.vue' },
            {  path: '/officeStudy', meta: { id: Mock.mock('@id'),title: '学习用品', pagemark: 'officeStudy', name: '学习用品' }, component: 'category.vue' },

            {  path: '/sundry', meta: { id: Mock.mock('@id'),title: '杂货铺', pagemark: 'sundry', name: '杂货铺' }, component: 'sundry.vue' },
            {  path: '/promotions', meta: { id: Mock.mock('@id'),title: '优惠促销', requireAuth: false, pagemark: 'promotions' , name: '优惠促销'}, component: 'promotions.vue' },
            // {  path: '/cart', meta: { id: Mock.mock('@id'),title: '购物车', requireAuth: true, pagemark: 'cart' , name: '购物车'}, component: 'cart.vue' },
            // {  path: '/detail', meta: { id: Mock.mock('@id'),title: '商品详细', requireAuth: false, pagemark: 'detail' , name: '商品详细'}, component: 'detail.vue' },
        ],
        code:210
    }
   
})

Mock.mock(RegExp(prefix+'/getsuperstorelist'+'.*'),'get',function(requestObj){
    return {
        data:[
            {id:Mock.mock('@id'),name:Mock.mock('@cword(6)')+'店'},
            {id:Mock.mock('@id'),name:Mock.mock('@cword(6)')+'店'},
            {id:Mock.mock('@id'),name:Mock.mock('@cword(6)')+'店'},
            {id:Mock.mock('@id'),name:Mock.mock('@cword(6)')+'店'},
            {id:Mock.mock('@id'),name:Mock.mock('@cword(6)')+'店'},
        ]
    }
})